<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>录入单号</title>
    <meta name="keywords" content="录入单号">
    <meta name="description" content="录入单号">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="__ADMIN__/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__ADMIN__/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__ADMIN__/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__ADMIN__/css/animate.min.css" rel="stylesheet">
    <link href="__ADMIN__/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <script src="__ADMIN__/js/jquery.min.js?v=2.1.4"></script>
    <link href="__ADMIN__/css/admin.css" rel="stylesheet">
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeIn">
        <div class="row">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <div class="tab-content">
                        <div class="panel-body">
                            <form method="post" class="form-horizontal" action="{:url('addexpress')}" data-type="ajax">
                                <input type="hidden" name="id" value="{$info.id}">

                                <div class="form-group">
                                    <label class="col-sm-2 control-label" style="float:left">订单编号：</label>
                                    <div class="col-sm-10">
                                        <label>{$info.order_sn}</label>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label" style="float:left">收货姓名：</label>
                                    <div class="col-sm-10">
                                        <label>{$info.consignee}</label>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label" style="float:left">收货手机：</label>
                                    <div class="col-sm-10">
                                        <label>{$info.mobile}</label>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label" style="float:left">收货地址：</label>
                                    <div class="col-sm-10">
                                        <label>{$info.address}</label>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label" style="float:left">快递单号：</label>
                                    <div class="col-sm-10">
                                        <input type="text" name='expressnum' class="form-control" style="width:500px" value="">
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>

                                <div class="form-group" style="text-align:center">
                                    <div class="col-sm-4 col-sm-offset-2">
                                        <button class="btn btn-primary" type="submit">提交</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="__ADMIN__/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="__ADMIN__/js/content.min.js?v=1.0.0"></script>
    <script src="__ADMIN__/js/plugins/iCheck/icheck.min.js"></script>
    <script src="__ADMIN__/js/plugins/layer/layer.min.js"></script>
    <script src="__ADMIN__/js/layer_hplus.js"></script>
    <script>
        $(document).ready(function() {
          var index = parent.layer.getFrameIndex(window.name);

          $(".btn-primary").click(function(){
            var id = $("input[name='id']").val();
            var url = $("form").attr('action');
            var expressnum = $("input[name='expressnum']").val();

            $.ajax({
                type: 'POST',
                dataType: 'json',
                url:url,
                data:{'id':id,'expressnum':expressnum},
                success: function(obj){
                    if(obj.status == 200){
                        layer.open({
                            content: obj.msg,
                            btn:['确定'],
                            shade:0.1,
                            icon:1,
                            end:function(){
                                window.parent.location.reload();//刷新原数据并关闭弹窗
                                parent.layer.close(index);
                            }
                        });
                    }else{
                        layer.open({
                            content: obj.msg,
                            btn:['确定'],
                            shade:0.1,
                            icon:2,
                            end:function(){
                                parent.layer.close(index);//关闭弹窗
                            }
                        });
                    }
                }
            });
          });
        });
    </script>
</body>

</html>
